package cn.com.open.itembank.service;

import cn.com.open.itembank.common.enums.PaperImportType;
import cn.com.open.itembank.dto.ImportParameter;
import cn.com.open.itembank.dto.ReturnModel;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 试卷导出
 */
@FeignClient(name = "item-paper-service")
public interface ItemBankRemotePaperExportService {

    // region 试卷导出

    /**
     * 试卷导出
     *
     * @param itemBankId  题库ID
     * @param testPaperId 试卷编号
     * @param exportType  是否含答案：0，试卷；1，试卷和答案；2，试卷含答案
     * @param appKey      appKey
     * @return the return model
     * @throws Exception the exception
     */
    @GetMapping(value = "/itembank/{itemBankId}/paper/{testPaperId}/export")
    ReturnModel paperExportWord(
            @PathVariable(value = "itemBankId") String itemBankId,
            @PathVariable(value = "testPaperId") String testPaperId,
            @RequestParam("exportType") PaperImportType exportType,
            @RequestParam("appKey") String appKey);

    //endregion

    // region 试卷导入

    /**
     * Import paper return model.
     *
     * @param itemBankId      题库id
     * @param importParameter 试卷导入模型
     * @return return model
     */
    @PostMapping(value = "/itembank/{itemBankId}/paper/import")
    ReturnModel importPaper(@PathVariable(value = "itemBankId") String itemBankId,
                            @RequestBody ImportParameter importParameter);
    //endregion


    // region 导出试卷xml

    /**
     * 导出试卷xml
     *
     * @param itemBankId  题库ID
     * @param appKey      appKey
     * @return the return model
     * @throws Exception the exception
     */
    @GetMapping(value = "/itembank/{itemBankId}/paper/exportxml")
    ReturnModel exportPaperXML(
            @PathVariable(value = "itemBankId") String itemBankId,
            @RequestParam("appKey") String appKey);

    //endregion
}
